package view;

import ucm.UC2ALAdapter;
import ucm.UCDisplayUserLogin;

import javax.swing.*;

/**
 *
 * @author Adam Scarr
 * @since r7
 */
public class MainMenu extends JMenuBar {
    private JMenuItem loginUser;
    private JMenuItem loginManager;
    private JMenuItem loginAdministrator;
    private JMenuItem exit;
    private JMenuItem about;

    public MainMenu() {
        JMenu file = new JMenu("File");
        file.setMnemonic('f');
        add(file);

        loginUser = new JMenuItem("Login as User");
        loginUser.setMnemonic('u');
        file.add(loginUser);
        loginUser.addActionListener(new UC2ALAdapter(new UCDisplayUserLogin()));

        loginManager = new JMenuItem("Login as Manager");
        loginManager.setMnemonic('m');
        file.add(loginManager);

        loginAdministrator = new JMenuItem("Login as Administrator");
        loginAdministrator.setMnemonic('a');
        file.add(loginAdministrator);

        file.add(new JSeparator());

        exit = new JMenuItem("Exit");
        exit.setMnemonic('x');
        file.add(exit);


        JMenu help = new JMenu("Help");
        help.setMnemonic('h');
        add(help);

        about = new JMenuItem("About");
        about.setMnemonic('a');
        help.add(about);
    }

}
